﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using daSyntaxAnalyser.SyntaxTree;

namespace CQLQueries.SyntaxTree
{
    public class RelationNode
    {
        public object NodeTree;
        public object ValueUp;

        public Relation2Node Relation2;
        public Relation1Node Relation1;

        public RelationNode()
        {            
        }

        public void Visit()
        {
            Relation2.NodeTree = NodeTree;
            Relation2.Visit();
            if (Relation1 != null)
            {
                Relation1.ValueDown = Relation2.ValueUp;
                Relation1.NodeTree = NodeTree;
                Relation1.Visit();
                ValueUp = Relation1.ValueUp;
            }
            else ValueUp = Relation2.ValueUp;
        }
    }
}
